﻿
<template>
<div class="card-fill layout-padding">
<el-card shadow="hover" class="layout-padding-auto" >
  <div>
    <el-form ref="formRefInnerAndOutRingRecord" :model="stateInnerAndOutRingRecord.vmModel" label-width="100px">
      <el-row>
        <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_InnerMFCode_FormItem" prop="Entity.InnerMFCode" :label="$t('message.autotrans._Model_InnerAndOutRingRecord_InnerMFCode')">
            <el-input v-model="stateInnerAndOutRingRecord.vmModel.Entity.InnerMFCode" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_InnerVSN_FormItem" prop="Entity.InnerVSN" :label="$t('message.autotrans._Model_InnerAndOutRingRecord_InnerVSN')">
            <el-input v-model="stateInnerAndOutRingRecord.vmModel.Entity.InnerVSN" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_OutMFcode_FormItem" prop="Entity.OutMFcode" :label="$t('message.autotrans._Model_InnerAndOutRingRecord_OutMFcode')">
            <el-input v-model="stateInnerAndOutRingRecord.vmModel.Entity.OutMFcode" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_OutVSN_FormItem" prop="Entity.OutVSN" :label="$t('message.autotrans._Model_InnerAndOutRingRecord_OutVSN')">
            <el-input v-model="stateInnerAndOutRingRecord.vmModel.Entity.OutVSN" clearable></el-input>
        </el-form-item>

        </el-col>
        <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_MatchFlag_FormItem" prop="Entity.MatchFlag" :label="$t('message.autotrans._Model_InnerAndOutRingRecord_MatchFlag')">
            <el-input v-model="stateInnerAndOutRingRecord.vmModel.Entity.MatchFlag" clearable></el-input>
        </el-form-item>

        </el-col>
      </el-row>

      <div style="text-align:right;">
        <WtmButton @click="onSubmitInnerAndOutRingRecord"  type="primary" :button-text="$t('message.autotrans.SysSubmit')" style="margin-top:15px;"/>

        <WtmButton @click="onCloseInnerAndOutRingRecord"  type="primary" :button-text="$t('message.autotrans.SysClose')" style="margin-top:15px;"/>

      </div>

    </el-form>

  </div>

</el-card>
</div>
</template>


<script setup lang="ts" name="message.autotrans._PageRecordInnerAndOutRingRecordCreate;false">
import {  ElMessageBox, ElMessage,ElLoading } from 'element-plus';
import { defineAsyncComponent,reactive, ref, getCurrentInstance, onMounted, nextTick } from 'vue';
import { innerandoutringrecordApi } from '/@/api/record/innerandoutringrecord';
import other from '/@/utils/other';
import fileApi from '/@/api/file';
import { useRouter } from "vue-router";
const ci = getCurrentInstance() as any;


// 定义变量内容
const formRefInnerAndOutRingRecord = ref();
const stateInnerAndOutRingRecord = reactive({
    vmModel: {
	  Entity:{
        InnerMFCode: '',
        InnerVSN: '',
        OutMFcode: '',
        OutVSN: '',
        MatchFlag: '',
      },

	},
    
});

// 取消
const onCloseInnerAndOutRingRecord = () => {
    closeDialog();
};

// 提交
const onSubmitInnerAndOutRingRecord = () => {
 	const loadingInstance = ElLoading.service({
		lock: true,
		text: '正在提交中，请等待。。。',
		background: 'rgba(0, 0, 0, 0.7)',
	});
   formRefInnerAndOutRingRecord.value?.validate((valid: boolean, fields: any) => {
		if (valid) {
            innerandoutringrecordApi().add(stateInnerAndOutRingRecord.vmModel).then(() => {
                ElMessage.success(ci.proxy.$t('message._system.common.vm.submittip'));
                emit('refresh');
                closeDialog();
            }).catch((error) => {
                other.setFormError(ci, error);
            }).finally(() => {
			loadingInstance.close();
		    })
		}
	})
};

// 页面加载时
onMounted(() => {
    
});

// 定义子组件向父组件传值/事件
const emit = defineEmits(['refresh','closeDialog']);
// 关闭弹窗
const closeDialog = () => {
    emit('closeDialog');
};
// 暴露变量
defineExpose({

});
</script>

<style scoped lang="scss">

</style>

